#ifndef INCLUDE_SYMBOL_H
#define INCLUDE_SYMBOL_H

#define NAME_LEN 4096
#define TABLE_LEN 4096

typedef int bool;

typedef struct ident {
    char name[NAME_LEN];
    char type[NAME_LEN];
    int address;
    int value;
    int def; // 0:变量; 1:常量
}Ident;

typedef struct ident_table {
    Ident *list[TABLE_LEN];
    int length;
}Table;

extern Table *table_global;
extern int register_cnt;

bool isInTable(char *name, Table *t);
Ident *findItem(char *name, Table *t);
void insertItem(Ident *ident, Table *t);
void printTable(Table *t);

#endif